~ chicken-core (chicken-5) /manual/Egg specification format


  1[[tags: manual]]
  2[[toc:]]
  3
  4
  5== Format of the egg description file
  6
  7An egg description is basically an association list holding
  8information about the components of the egg. An egg may contain
  9multiple components: libraries, programs, Scheme or C include files
 10and arbitrary data files. Dependencies between eggs can be
 11specified as can be dependencies between components of an egg.
 12
 13A list of valid properties follows.
 14
 15=== Global properties
 16
 17==== version
 18
 19 [egg property] (version STRING)
 20
 21Specifies version string for this egg. {{STRING}} should have
 22the format {{<MAJOR>.<MINOR>.<PATCHLEVEL>}}, where only the
 23{{<MAJOR>}} part is mandatory.
 24
 25Eggs from remote egg servers are automatically versioned - the
 26version is part of the protocol to retrieve the egg and does not
 27have to be specified in the {{.egg}} file. Eggs installed from
 28local directories (see below) should explicitly specify a version.
 29
 30==== synopsis
 31
 32 [egg property] (synopsis STRING)
 33
 34Gives a short description of this egg.
 35
 36==== author
 37
 38 [egg property] (author STRING)
 39
 40Names the author or authors of the contained code.
 41
 42==== maintainer
 43
 44 [egg property] (maintainer STRING)
 45
 46Names the maintainer of this code, if different from author(s).
 47
 48==== category
 49
 50 [egg property] (category NAME)
 51
 52Gives the category under which this egg should be contained.
 53See [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|the egg index]]
 54for a list of currently used categories.
 55
 56==== license
 57
 58 [egg property] (license STRING)
 59
 60Names the license under which this code is available.
 61
 62==== dependencies
 63
 64 [egg property] (dependencies EGG ...)
 65
 66Lists eggs that this egg depends on, and which should be
 67built and installed if they do not already exist in the repository.
 68{{EGG}} should be whether a symbol or a list of the form
 69{{EGGNAME VERSION}}, where the former means to install the
 70newest available egg with this name and the latter specifies
 71a specific version or higher.
 72
 73This property can also be used to specify a minimum version of CHICKEN
 74required by the egg.  For example, to require at least CHICKEN 5.3.0:
 75
 76<enscript highlight=scheme>
 77(dependencies (chicken "5.3.0"))
 78</enscript>
 79
 80==== test-dependencies
 81
 82 [egg property] (test-dependencies EGG ...)
 83
 84Lists eggs that are required for this egg to run the tests
 85(if tests exist.) This only has an effect if the {{-test}}
 86option has been given to {{chicken-install}}.
 87
 88==== build-dependencies
 89
 90 [egg property] (build-dependencies EGG ...)
 91
 92Lists eggs that are build-time dependencies for this egg,
 93i.e. there are required to build, but not to run the contained
 94code. Currently this is treated identical to {{dependencies}}.
 95
 96==== foreign-dependencies
 97
 98 [egg property] (foreign-dependencies NAME ...)
 99
100Lists external dependencies like native code libraries
101or system-specific packages and is currently only used for
102documentation purposes.
103
104==== platform
105
106 [egg property] (platform PLATFORM)
107
108Specifies for which platform this egg is intended. {{PLATFORM}}
109should be a symbol naming the target platform ({{windows}}, {{linux}}
110or {{unix}}) or a boolean combination of platform values, allowed
111are {{(not PLATFORM)}}, {{(or PLATFORM ...)}} and {{(and PLATFORM ...)}}.
112If the expression can not be satisfied, then installation of this
113egg will abort.
114
115==== distribution-files
116
117 [egg property] (distribution-files FILE ...)
118
119List of files required for the installation of the egg.  This
120form is not handled by chicken-install, but by henrietta-cache to
121determine what to cache. If the repository contains additional
122files that are unneeded for the egg to be installed, you can list
123all the required files in this clause to reduce the amount of data
124cached by egg servers.
125
126==== components
127
128 [egg property] (components COMPONENT ...)
129
130Lists components (extensions, programs, include- or data files) that
131this extension installs. See [[#component-types|Component types]] and
132[[#component-properties|component properties]] for information on how
133to specify component-specific information.
134
135==== host
136
137 [egg property] (host PROP ...)
138
139Recursively process {{PROP ...}}, but only for the host (build)
140platform, in case this is a "cross-chicken", a CHICKEN installation
141intended for cross compilation.
142
143==== target
144
145 [egg property] (target PROP ...)
146
147Recursively process {{PROP ...}}, but only for the target
148platform, in case this is a "cross-chicken", a CHICKEN installation
149intended for cross compilation.
150
151==== component-options
152
153 [egg property] (component-options OPTIONSPEC ...)
154
155Specifies global options for all programs and extensions compiled for this egg.
156{{OPTIONSPEC}} may be {{csc-options}}, {{link-options}} or {{linkage}} specifications.
157
158==== cond-expand
159
160 [egg property] (cond-expand CLAUSE ...)
161
162Conditionally expand egg specification forms, depending on system 
163features. Each {{CLAUSE}} should be of the form 
164{{(TEST PROPERTY)}} where {{TEST}} is a feature identifier or a 
165conditional form, in the same syntax as used in the {{cond-expand}}
166syntactic form.
167
168In addition to normal system-wide feature identifiers, feature identifiers
169given via the {{-feature}} option to {{chicken-install}} are visible in
170the tests. Also, the features {{target}}, {{host}}, {{dynamic}} and
171{{static}} are visible, depending on surrounding egg specification
172forms for constraining mode and linkage.
173
174==== error
175
176 [egg property] (error STRING ARG ...)
177
178Signal an error and abort processing. Mostly useful inside {{cond-expand}} forms.
179
180=== Component types
181
182==== extension
183
184 [egg property] (extension NAME PROP ...)
185
186Specifies an extension library component. The properties
187{{PROP...}} are processed recursively and apply only to this
188component.
189
190==== data
191
192 [egg property] (data NAME PROP ...)
193
194Specifies one or more arbitrary data files.
195
196==== generated-source-file
197
198 [egg property] (generated-source-file NAME PROP ...)
199
200Specifies a file that is generated during the process of building
201the egg.
202
203==== c-include
204
205 [egg property] (c-include NAME PROP ...)
206
207Specifies one or more C include files.
208
209==== scheme-include
210
211 [egg property] (scheme-include NAME PROP ...)
212
213Specifies one or more Scheme include files.
214
215==== program
216
217 [egg property] (program NAME PROP ...)
218
219Specifies an executable program.
220
221==== c-object
222
223 [egg property] (c-object NAME PROP ...)
224
225Specifies a compiled C/C++ object file. Usually this component type
226is required if you want to link a separately compiled C/C++ module
227with your extension or program. C-objects are compiled like Scheme
228source files with the {{csc}} tool to ensure the same C compiler
229options and toolchain is used as for regular Scheme files compiled
230to C. If you want to pass compiler-specific options to the build
231of the C object, use the {{csc-options}} property and precede
232C compiler options with {{-C}}.
233
234
235=== Component properties
236
237==== host
238
239 [egg property] (host PROP ...)
240
241Process {{PROP ...}} recursively for the current component, but
242apply the properties only to the host (build) part, when using
243a CHICKEN installation intended for cross-compilation.
244
245==== target
246
247 [egg property] (target PROP ...)
248
249Process {{PROP ...}} recursively for the current component, but
250apply the properties only to the target part, when using
251a CHICKEN installation intended for cross-compilation.
252
253==== linkage
254
255 [egg property] (linkage LINKAGE)
256
257Define whether the component should be linked dynamically or
258statically. {{LINKAGE}} can be {{static}} or {{dynamic}}. This
259property only makes sense for extension libraries.
260
261==== types-file
262
263 [egg property] (types-file [NAME])
264
265Specifies that a "type-database" file should be generated and
266installed for this component. This property is only used for
267extension libraries. The name is optional and defaults to the
268name of the extensions (with the proper extension).
269
270If {{NAME}} is a list of the form {{(predefined [NAME])}}, then
271no types file is created during compilation and an existing types file 
272for this extension is assumed and installed.
273
274==== inline-file
275
276 [egg property] (inline-file [NAME])
277
278Specifies that an "inline" file should be generated and installed
279for this component. This property is only used for extension
280libraries. The name is optional and defaults to the
281name of the extensions (with the proper extension).
282
283==== custom-build
284
285 [egg property] (custom-build STRING)
286
287Specifies a custom build operation that should be executed instead of
288the default build operations. This property is mandatory for
289components of type {{generated-source-file}}. {{STRING}} should be the
290name of a shell command (e.g., a script) and thus may be platform
291sensitive.  The path to the file is prepended implicitly, so you
292should '''not''' prefix it with {{./}}.  On Windows, a file with the
293{{.bat}} extension will be picked before a plain file with no
294extension.
295
296The script will be made executable on UNIX systems, if necessary,
297and will be invoked like the {{csc}} program and
298is executed with the location of the CHICKEN
299binaries in the {{PATH}}. Also, the following environment variables
300are set in the execution environment of the script:
301
302* {{CHICKEN_CC}}: name of the C compiler used for building CHICKEN
303* {{CHICKEN_CXX}}: name of the C++ compiler set during the build of CHICKEN
304* {{CHICKEN_CSC}}: path to {{csc}}
305* {{CHICKEN_CSI}}: path to {{csi}}
306
307
308==== csc-options
309
310 [egg property] (csc-options OPTION ...)
311
312Specifies additional compiler options for {{csc}} that should be
313used when building this component. If this property is not
314given, the default options are used, which are {{-O2 -d1}}
315for extensions and programs and {{-O2 -d0}} for import
316libraries.
317
318Note that the options are quoted when passed to csc during the
319compilation of the extension, so multiple options should be specified
320as {{(csc-options "OPT1" "OPT2" ...)}} instead of {{(csc-options "OPT1 OPT2")}}
321(the latter would be a single option containing a whitespace character).
322
323==== link-options
324
325 [egg property] (link-options OPTION ...)
326
327Specifies additional link options for {{csc}} that should be
328used when building this component.
329
330Note that the options are quoted when passed to csc during the
331compilation of the extension, so multiple options should be specified
332as {{(link-options "OPT1" "OPT2" ...)}} instead of {{(link-options "OPT1 OPT2")}}
333(the latter would be a single option containing a whitespace character).
334
335Note that in order to pass linker options to the underlying C-compiler, these must
336be prefixed with {{-L}}, eg. {{(link-options "-L" "-lpng")}}.
337
338==== source
339
340 [egg property] (source NAME)
341
342Specifies an alternative source file, in case it has a name
343distinct from the component name. By default the source file
344for a component is named after the component, with the {{.scm}}
345extension added.
346
347==== install-name
348
349 [egg property] (install-name NAME)
350
351Specifies an alternative installation name of the component,
352if it differs from the actual component name. This property
353is most useful if an egg installs an extension and a program
354of the same name, but needs to distinguish the components during
355build time.
356
357==== component-dependencies
358
359 [egg property] (component-dependencies NAME ...)
360
361Specifies dependencies to other components. {{NAME ...}} must
362be the names of extension, program, scheme-include- or generated source file
363components that should be built before the current component.
364
365==== source-dependencies
366
367 [egg property] (source-dependencies NAME ...)
368
369Specifies dependencies to additional source files. {{NAME ...}} must
370denote filenames of which the program or extension depends.
371A program or extension implicitly depends on its source file and
372and on the egg-specification file.
373
374==== objects
375
376 [egg property] (objects NAME ...)
377
378Specifies that the components of type {{c-object}} should be linked
379to this component and that the object components are dependencies.
380
381
382==== destination
383
384 [egg property] (destination NAME)
385
386Specifies an alternative installation destination for the
387built component and only applies
388to components of type {{data}}, {{c-include}} and {{scheme-include}}.
389This property should only be used in extreme
390cases, as it is recommended to use the default installation 
391locations, which are:
392
393* for C include files: {{<PREFIX>/include/chicken/}}
394
395* for Scheme include files: {{<PREFIX>/share/chicken/}}
396
397* for data files: {{<PREFIX>/share/chicken/}}
398
399==== files
400
401 [egg property] (files NAME ...)
402
403Specifies source files for this component and only applies
404to components of type {{data}}, {{c-include}} and {{scheme-include}}.
405Both files and directories may be given and parent directories
406are created as needed.
407
408==== modules
409
410 [egg property] (modules NAME ...)
411
412Specifies modules that the component (usually an extension) contains.
413{{chicken-install}} will compile and install all import libraries for the given modules.
414If this property is not given, then it is assumed that the extension has a single
415module of the same name as the component.
416
417==== cond-expand
418
419 [egg property] (cond-expand CLAUSE ...)
420
421Similar to the toplevel {{cond-expand}} clause and may appear inside
422component specifications.
423
424==== error
425
426 [egg property] (error STRING ARG ...)
427
428Similar to the toplevel {{error}} form, may appear inside component specifications.
429
430---
431
432Previous: [[Extension tools]]
433
434Next: [[Units and linking model]]
Trap